<?php
Yii::import('zii.widgets.CPortlet');

class BannerModule extends CPortlet {
    public $position = 1;

    public function renderContent() {
        $criteria = new CDbCriteria;
        $criteria->compare('status', APPROVED);
        $criteria->compare('position', $this->position);

        $dataBanners = Cache::usingCache('Banner', $criteria);
        $this->render('vwBanners', array(
            'dataBanners' => $dataBanners,
            'position' => $this->position
        ));
    }
}
